#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <iostream>//must be removed
#include <fstream>
#include <string>
#include <cstdlib>
#include <math.h> //must be removed

#include "excepts.h"
#include "geometry.h"


#include "mesh.h"
#include "globals.h"
#include "neuread.h"
#include "prop.h"

using namespace std;
//using namespace ABAN;
//----------------------------------------------------------------------------
/*void showFractCoord(CellIterator X)
{
  cout<<"Fractional Coordination for cell no: "<<X->no<<endl;
  for (int i=0;i<3;i++)
  {
    cout<<X->fractCoord[i].numerator<<"/"<<X->fractCoord[i].denominator;
    cout<<endl;
  }
}*/
//----------------------------------------------------------------------------
/*void showNeighbors(CellIterator X)
{
  cout<<"Neighborhood for cell no: "<<X->no<<endl;
  for (SeqType i=dirXP;i<noOfDirections;i++)
    {
      cout<<"Neighbor "<<i<<" "<<X->neighbors[i]->size()<<" ";
      if (X->neighbors[i]->size())
       for (CellNeighborhoodSetIterator Y=X->neighbors[i]->begin();Y!=X->neighbors[i]->end();Y++)
        cout<<(*Y)->no<<",";
      else
        cout<<"NONE ";
      cout<<endl;
    }
    
  cout<<endl;
  
}*/
//----------------------------------------------------------------------------
int main(int argc, char *argv[])
{
/*  cout<<"Fucking mother of KDevelope has been started!"<<endl;
  
  nodes = new VectorContainer();
  cells = new CellContainer();
  
  cout<<"Reading mesh file... ";
  readNeuFile(*nodes,*cells,"/home/ebrahim/Desktop/10x10x10.neu");
  cout<<"done."<<endl;
  
  cout<<"Processing neighborhoods... "<<endl;;
  cells->checkForMatchingNeighbors();
  cout<<"done."<<endl;*/
  
// 
//   //Printing Neighborhood
//   CellIterator a,b,c;
//   a = b = c = cells->begin();
//   for (SeqType i = 0; i<35;i++) a++;
//   c = b = a;
//   b++;
// 
//   cells->breakCell(a,dirXP);
//   cells->breakCell(a,dirYP);
//   cells->breakCell(b,dirYP);
//   cells->breakCell(b,dirYP);
//   cells->breakCell(b,dirYP);
//   cells->breakCell(a,dirYP);
//   
//   cout<<"-------------------------------"<<endl;
// //   showFractCoord(b);  
//   
//   showNeighbors(a);
//   c = cells->end();
//   c--;c--;
//   cells->coarseCell(b,c,dirYP);
//   c = cells->end();
//   c--;c--;
//   cells->coarseCell(b,c,dirYP);
//   showNeighbors(b);
//   
//   delete nodes;
//   delete cells;

  
/*  CellIterator a;
  a=cells->begin();
  for (SeqType i = 0; i<435;i++) a++;*/
/*  cells->breakCell(a,dirYP);
  cells->breakCell(a,dirXP);
  cells->breakCell(a,dirYP);
  cells->breakCell(a,dirXP);
  cells->breakCell(a,dirYP);
  cells->breakCell(a,dirXP);
  cells->breakCell(a,dirZP);
  cells->breakCell(a,dirZP);
  cells->breakCell(a,dirZP);*/
  
/*  for (CellIterator toBeTested = cells->begin(); toBeTested!=cells->end(); toBeTested++)
  {
    cells->u->push_back( toBeTested->center[dirXP]*10.0+
                         toBeTested->center[dirYP]*10.0+
                         toBeTested->center[dirZP]*10.0+7.0);
    cells->v->push_back( toBeTested->center[dirXP]*0.0+
                         toBeTested->center[dirYP]*0.0+
                         toBeTested->center[dirZP]*0.0+0.0);
    cells->w->push_back( toBeTested->center[dirXP]*0.0+
                         toBeTested->center[dirYP]*0.0+
                         toBeTested->center[dirZP]*0.0+0.0);
  }
  

  Vector vec;
    
    for (SeqType i = 0; i<cells->size();i++)
        cout<<"cell no "<<i<<"    "<<(*cells->u)[i]<<"    "<<(*cells->v)[i]<<"    "<<(*cells->w)[i]<<endl;
    
    EulerBackwardPropellant* ebp;
    ebp=new EulerBackwardPropellant(1.0,1.0,1e-2);
    ebp->calc(cells);
    
    for (SeqType i = 0; i<cells->size();i++)
        cout<<"cell no "<<i<<"    "<<(*cells->u)[i]<<"    "<<(*cells->v)[i]<<"    "<<(*cells->w)[i]<<endl;
   
*/





/*  ABAN::Vector a;
  std::cout<<a[0];*/
//    ABAN::Cell a;
  return EXIT_SUCCESS;
}
